/*
 * Copyright (C) 2010 M. Hautle.
 * 
 * This file is part of TrackedBean.
 * 
 * TrackedBean is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option) any later version.
 * 
 * TrackedBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License along with TrackedBean. If not, see <http://www.gnu.org/licenses/>.
 */
package ch.trackedbean.internal.weaving;

import org.eclipse.osgi.baseadaptor.loader.*;
import org.osgi.framework.*;

/**
 * Interface for the internal weaving services of TrackedBean.
 * 
 * @author M. Hautle
 */
public interface ITrackedBeanWeavingService {
    /**
     * Processes the given class before it get's defined.<br>
     * The implementation checks if it's necessary to modify the class and injects then the TrackedBean code.
     * 
     * @param name The name of the class
     * @param classbytes The bytes of the class
     * @param manager The responsible class path manager
     * @return The modified array or null if no modification is desired
     */
    byte[] processClass(String name, byte[] classbytes, ClasspathManager manager);

    /**
     * Returns the symbolic name of the bundle ({@link Bundle#getSymbolicName()}) for which this service instance is responsible.
     * 
     * @return The bundle id
     */
    String getAssociatedBundle();
}
